#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2020-08-26 17:44:33
# @Author  : Zuo Zhongfei (zuozhongfei@126.com)
# @Link    : www
# @Version : $Id$
# 骰子类

# import os
from random import randint


class Die():
    """骰子类"""

    def __init__(self, sides):
        # 骰子的面数
        self.sides = sides

    # 投掷骰子，得到一个数值
    def roll_die(self):
        return randint(1, self.sides)


# 创建一个6面骰子，掷10次
six_die = Die(6)
for x in range(1, 11):
    value = six_die.roll_die()
    print("第" + str(x) + "次掷" + str(six_die.sides)
          + "面骰子，" + "骰子的值为：" + str(value))
print('\n')

# 创建一个10面骰子，掷10次
ten_die = Die(10)
for x in range(1, 11):
    value = ten_die.roll_die()
    print("第" + str(x) + "次掷" + str(ten_die.sides) +
          "面骰子，" + "骰子的值为：" + str(value))
print('\n')

# 创建一个20面骰子，掷10次
twenty_die = Die(20)
for x in range(1, 11):
    value = twenty_die.roll_die()
    print("第" + str(x) + "次掷" + str(twenty_die.sides)
          + "面骰子，" + "骰子的值为：" + str(value))
